import axios from "axios"
// http://121.89.205.189:3001/apidoc/#api-Address-GetAddressList

const isDev = process.env.NODE_ENV === 'development' // 判断当前的运行环境的
const request =axios.create({
    baseURL: isDev?'http://121.89.205.189:3001/api':'http://121.89.205.189:3001/api',
    timeout:6000,
})

// 请求拦截器
request.interceptors.request.use(config=>{
  config.headers.token=localStorage.getItem('token');//请求拦截器：给所有的请求的头信息中携带token信息
 
  return config
},error=>{
  return Promise.reject(error)
});
  
  // 响应拦截器
  request.interceptors.response.use((response) => {

    return response
  }, (error) => {
    return Promise.reject(error)
  })
  




  export default request
  